package com.tsy.server.manage.controller;

import com.tsy.server.component.security.SecurityUtils;
import com.tsy.server.manage.model.dto.WorkspaceDTO;
import com.tsy.server.manage.service.IWorkspaceService;
import com.dji.sdk.common.HttpResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Optional;


/**
 * @author sean.zhou
 * @version 0.1
 * @date 2021/11/23
 */
@RestController
@RequestMapping("${url.manage.prefix}/workspaces")
public class WorkspaceController {

//    @Autowired
//    private IWorkspaceService workspaceService;
//
//    /**
//     * 获取当前用户所在的工作空间信息。
//     * @param request
//     * @return
//     */
//    @GetMapping("/current")
//    public HttpResultResponse getCurrentWorkspace(HttpServletRequest request) {
//        String workSpaceId = SecurityUtils.getWorkspaceId();
//        Optional<WorkspaceDTO> workspaceOpt = workspaceService.getWorkspaceByWorkspaceId(workSpaceId);
//
//        return workspaceOpt.isEmpty() ? HttpResultResponse.error() : HttpResultResponse.success(workspaceOpt.get());
//    }
}